Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

335
Views
Why unable to resolve module specifier "firebase/app"

My JS Code goes as:

import { initializeApp } from "firebase/app";


const firebaseConfig = {
   //config object
  };

 
const app = initializeApp(firebaseConfig);

Im getting this error since a very long time and would like someone to please look into it:

Failed to resolve module specifier "firebase/app". Relative references must start with either "/", "./", or "../".

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Did you has been followed the steps from the official docs?

  1. Step 1: Create a Firebase project and register your app
  2. Step 2: Install the SDK and initialize Firebase

This page describes setup instructions for version 9 of the Firebase JS SDK, which uses a JavaScript Module format.

This workflow uses npm and requires module bundlers or JavaScript framework tooling because the v9 SDK is optimized to work with module bundlers to eliminate unused code (tree-shaking) and decrease SDK size.

2.a. Install Firebase using npm

npm install firebase

2.b. Initialize Firebase in your app and create a Firebase App object

import { initializeApp } from 'firebase/app';

// TODO: Replace the following with your app's Firebase project configuration
const firebaseConfig = {
  //...
};

const app = initializeApp(firebaseConfig);
  1. Access Firebase in your app

Firebase services (like Cloud Firestore, Authentication, Realtime Database, Remote Config, and more) are available to import within individual sub-packages.

The example below shows how you could use the Cloud Firestore Lite SDK to retrieve a list of data.

import { initializeApp } from 'firebase/app';
import { getFirestore, collection, getDocs } from 'firebase/firestore/lite';
// Follow this pattern to import other Firebase services
// import { } from 'firebase/<service>';

// TODO: Replace the following with your app's Firebase project configuration
const firebaseConfig = {
  //...
};

const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

// Get a list of cities from your database
async function getCities(db) {
  const citiesCol = collection(db, 'cities');
  const citySnapshot = await getDocs(citiesCol);
  const cityList = citySnapshot.docs.map(doc => doc.data());
  return cityList;
}

You could refer my answer to the official link below

https://firebase.google.com/docs/web/setup

Hopefully can help you.

about 4 years ago · Juan Pablo Isaza Report

0

Finally I got my issue resolved by using the following method to import functions :

import { function } from 'https://www.gstatic.com/firebasejs/9.6.3/firebase-SERVICE.js'

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!